package com.game.controller;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.game.modal.User;
import com.game.service.IUserService;
import com.game.util.ResultInfo;

@RequestMapping("/user")
@RestController
public class UserController {
	
	@Autowired
	private IUserService userService;
	@RequestMapping("/login")
	public ResultInfo login(User user){
		ResultInfo result = ResultInfo.ERROR;
		try {
			result = userService.login(user);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
	}
}
